package com.cssy.xxkj.logic.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.cssy.xxkj.logic.dao.LogicOutsideBoundItemDAO;
import com.cssy.xxkj.logic.entity.LogicOutsideBoundItemDO;
import com.plat.exception.SyBaseException;

/**
 * 数据访问对象实现类
 * @since 2014-10-14
 */
public class LogicOutsideBoundItemDAOImpl extends SqlMapClientDaoSupport implements LogicOutsideBoundItemDAO {

    /**
     * 插入数据
     * @param logicOutsideBoundItemDO
     * @return 插入数据的主键
     */
    public String insertLogicOutsideBoundItemDO(LogicOutsideBoundItemDO logicOutsideBoundItemDO) {
        Object id = getSqlMapClientTemplate().insert("LogicOutsideBoundItem.insert", logicOutsideBoundItemDO);
        return (String) id;
    }

    /**
     * 统计记录数
     * @param logicOutsideBoundItemDO
     * @return 查出的记录数
     */
    public Integer countLogicOutsideBoundItemDOByExample(LogicOutsideBoundItemDO logicOutsideBoundItemDO) {
        Integer count = (Integer) getSqlMapClientTemplate().queryForObject("LogicOutsideBoundItem.countByDOExample", logicOutsideBoundItemDO);
        return count;
    }

    /**
     * 更新记录
     * @param logicOutsideBoundItemDO
     * @return 受影响的行数
     */
    public Integer updateLogicOutsideBoundItemDO(LogicOutsideBoundItemDO logicOutsideBoundItemDO) {
        int result = getSqlMapClientTemplate().update("LogicOutsideBoundItem.update", logicOutsideBoundItemDO);
        return result;
    }

    /**
     * 获取对象列表
     * @param logicOutsideBoundItemDO
     * @return 对象列表
     */
    @SuppressWarnings("unchecked")
    public List<LogicOutsideBoundItemDO> findListByExample(LogicOutsideBoundItemDO logicOutsideBoundItemDO) {
        List<LogicOutsideBoundItemDO> list = getSqlMapClientTemplate().queryForList("LogicOutsideBoundItem.findListByDO", logicOutsideBoundItemDO);
        return list;
    }
    
    @SuppressWarnings("unchecked")
	public List<LogicOutsideBoundItemDO> findListByMap(Map<String, Object> paramMap)
			throws SyBaseException{
    	List<LogicOutsideBoundItemDO> list = getSqlMapClientTemplate().queryForList("LogicOutsideBoundItem_ex.findListByMap", paramMap);
        return list;
    }

    /**
     * 根据主键获取logicOutsideBoundItemDO
     * @param id
     * @return logicOutsideBoundItemDO
     */
    public LogicOutsideBoundItemDO findLogicOutsideBoundItemDOByPrimaryKey(String id) {
        LogicOutsideBoundItemDO logicOutsideBoundItemDO = (LogicOutsideBoundItemDO) getSqlMapClientTemplate().queryForObject("LogicOutsideBoundItem.findByPrimaryKey", id);
        return logicOutsideBoundItemDO;
    }

    /**
     * 删除记录
     * @param id
     * @return 受影响的行数
     */
    public Integer deleteLogicOutsideBoundItemDOByPrimaryKey(String id) {
        Integer rows = (Integer) getSqlMapClientTemplate().delete("LogicOutsideBoundItem.deleteByPrimaryKey", id);
        return rows;
    }

}